/*    */ package handling.login.handler;
/*    */ 
/*    */ import client.MapleCharacter;
/*    */ import client.MapleClient;
/*    */ import client.MapleEnumClass;
/*    */ import handling.channel.ChannelServer;
/*    */ import handling.world.World;
/*    */ import java.util.List;
/*    */ import tools.data.input.LittleEndianAccessor;
/*    */ import tools.packet.LoginPacket;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class CharlistRequestHandler
/*    */ {
/*    */   public static void handlePacket(LittleEndianAccessor slea, MapleClient c) {
/* 25 */     slea.readByte();
/* 26 */     slea.readByte();
/* 27 */     int server = 0;
/* 28 */     int channel = slea.readByte() + 1;
/* 29 */     boolean useKey = (slea.readByte() == 1);
/* 30 */     if (useKey) {
/* 31 */       slea.readByte();
/*    */ 
/*    */       
/* 34 */       LoginPasswordHandler.handlerAuthKey(slea, c);
/*    */     } 
/*    */ 
/*    */ 
/*    */ 
/*    */     
/* 40 */     if (!World.isChannelAvailable(channel)) {
/* 41 */       c.announce(LoginPacket.getLoginFailed(MapleEnumClass.AuthReply.GAME_CONNECTION_BUSY));
/*    */       
/*    */       return;
/*    */     } 
/* 45 */     if (!c.isLoggedIn()) {
/* 46 */       c.getSession().close();
/*    */       
/*    */       return;
/*    */     } 
/* 50 */     System.out.println("客户地址: " + c.getSessionIPAddress() + " 连接到世界服务器: " + server + " 频道: " + channel);
/*    */     
/* 52 */     c.setChannel(channel);
/* 53 */     List<MapleCharacter> chars = c.loadCharacters(server);
/* 54 */     if (chars != null && ChannelServer.getInstance(channel) != null) {
/* 55 */       c.setWorld(server);
/* 56 */       c.setChannel(channel);
/*    */       
/* 58 */       c.announce(LoginPacket.getCharList(c.getSecondPassword(), chars, c.getAccCharSlots()));
/*    */     } else {
/*    */       
/* 61 */       c.getSession().close();
/*    */     } 
/*    */   }
/*    */ }


/* Location:              C:\PGX\Server.jar!\handling\login\handler\CharlistRequestHandler.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */